<?php

class member_management {	
	
	function getMemberById($memberId) {
		$sql="SELECT * FROM tbl_users WHERE user_id='$memberId'";
		$rst=mysql_query($sql);
		$num = mysql_num_rows($rst);
		if($num > 0) { return $row = mysql_fetch_array($rst); }
		else { return false; }
	}
	
	function getAllMembers() {
		$sql="SELECT * FROM tbl_temp_user where status='1' ORDER BY user_id DESC";
		$rst=mysql_query($sql);
		$num = mysql_num_rows($rst);		
		if($rst) { 
			return $rst;
		}
		else { return false; }
	}
	
	function getUserImage($userId) {
		$sql="SELECT profile_sample, profile_thumb FROM tbl_users where user_id='$userId'";
		$rst=mysql_query($sql);
		$num = mysql_num_rows($rst);		
		if($rst) { 
			$row = mysql_fetch_row($rst);
			return $row;
		}
		else { return false; }
	}
	
	function updateUserInfo($userId,$fname,$lname,$address1,$address2,$city,$state,$country,$zip,$phone,$email,$age,$about) {
		$sql = "UPDATE tbl_users SET first_name='".$fname."',
					last_name='".$lname."',
					address_line_1='".$address1."',
					address_line_2='".$address2."',					
					city='".$city."',
					state='".$state."',
					country='".$country."',
					zip='".$zip."',
					phone_number_1='".$phone."',
					age='".$age."',
					about_me='".$about."',					
					email='".$email."' WHERE user_id='$userId'";
		$rst = mysql_query($sql) or die(mysql_error());
		if($rst) { return true; }
		else { return false; }					
	}
		
	
}	 
?>